FROM registry.cn-beijing.aliyuncs.com/yangzhetony/cnp:1.0
COPY ./OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz /var/OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz
COPY ./elasticsearch-7.8.0-linux-x86_64.tar.gz /var/elasticsearch-7.8.0-linux-x86_64.tar.gz
RUN cd /var && tar zxvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz && \
    tar zxvf elasticsearch-7.8.0-linux-x86_64.tar.gz
COPY ./docker.sh /var/docker.sh
RUN cd /var && tar zxvf OpenJDK17U-jdk_x64_linux_hotspot_17.0.10_7.tar.gz
COPY ./profile /etc/profile
RUN source /etc/profile
RUN mkdir -p /var/elasticsearch-data
COPY ./jvm.options /var/elasticsearch-7.8.0/config/jvm.options
COPY ./elasticsearch.yml /var/elasticsearch-7.8.0/config/elasticsearch.yml
RUN groupadd elastic && useradd elastic -g elastic -p elasticsearch && cd /var && \
    chown -R elastic:elastic elasticsearch-7.8.0 && \
    chown -R elastic:elastic elasticsearch-data
# RUN su elastic && cd /var/elasticsearch-7.8.0/bin && ./elasticsearch -d

CMD ["sh","/var/docker.sh",">","logfile.log","2>&1"]